﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RecipeManager
{
    public partial class FilterForm : Form
    {
        public event EventHandler FilterChanged;
        public void OnFilterChanged(object sender, EventArgs e)
        {
            if (FilterChanged != null)
            {
                FilterChanged(sender, e);
            }
        }

        BindingList<FilterItem> _filterList = new BindingList<FilterItem>();
        public BindingList<FilterItem> FilterList
        {
            get { return _filterList; }
        }

        public FilterForm()
        {
            InitializeComponent();
            FilterBinding.DataSource = FilterList;
            _filterList.AddingNew += (x, y) => OnFilterChanged(x, y);
            _filterList.ListChanged += (x, y) => OnFilterChanged(x, y);
        }

    }
}
